Skip to content

Fix PM5 auto-off leaving the board unable to power back on - #3566

Open
nemanjan00 wants to merge 2 commits into
RfidResearchGroup:masterfrom
nemanjan00:pm5-autooff-grace-period
Open

Fix PM5 auto-off leaving the board unable to power back on#3566
nemanjan00 wants to merge 2 commits into
RfidResearchGroup:masterfrom
nemanjan00:pm5-autooff-grace-period

Conversation

@nemanjan00

Copy link
Copy Markdown
Contributor

bwm_autooff_check() released the power latch on the first VUSB-absent sample, ~250ms after VBUS was pulled. With a BWM fitted that lands while the AW32001E is still transitioning into Battery Discharge Mode, where BATFET is only turned fully on as part of that transition. The board powered down mid-transition and could then not be brought back up by button or by USB insertion - it looked dead until the cell was physically re-inserted.

Require the absence to persist for 5s (20 consecutive 250ms samples) before acting, resetting the count whenever USB reappears. This is the grace period the function's own comment already described, and it also means a single spurious low reading on PC2 - a floating input, configured GPIO_PULL_NONE - can no longer power down a working device.

The 5s figure is empirical rather than derived from a datasheet settling time. Other users report auto-off working on their boards, so this makes a marginal path robust rather than fixing something broken everywhere.

nemanjan00 and others added 2 commits September 1, 2026 01:23
bwm_autooff_check() released the power latch on the first VUSB-absent
sample, ~250ms after VBUS was pulled. With a BWM fitted that lands while
the AW32001E is still transitioning into Battery Discharge Mode, where
BATFET is only turned fully on as part of that transition. The board
powered down mid-transition and could then not be brought back up by
button or by USB insertion - it looked dead until the cell was physically
re-inserted.

Require the absence to persist for 5s (20 consecutive 250ms samples)
before acting, resetting the count whenever USB reappears. This is the
grace period the function's own comment already described, and it also
means a single spurious low reading on PC2 - a floating input, configured
GPIO_PULL_NONE - can no longer power down a working device.

The 5s figure is empirical rather than derived from a datasheet settling
time. Other users report auto-off working on their boards, so this makes
a marginal path robust rather than fixing something broken everywhere.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@nemanjan00

Copy link
Copy Markdown
Contributor Author

Om, this was only partial fix for me. If it stays off longer than a min-two minutes, I need to unplug battery to have it power on again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant